package org.vshe.improve.spring.prospring3.ch6.annotation;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MethodInvocationWatcher implements MethodInterceptor {
	public Object invoke(MethodInvocation invocation) throws Throwable {
		String invocationObject = invocation.getStaticPart().getClass()
				.getSimpleName()
				+ "." + invocation.getMethod().getName();

		System.out.println("INVOKING >>> " + invocationObject);

		Object retValue = invocation.proceed();

		System.out.println("INVOKING >>> " + invocationObject);

		return retValue;
	}

}
